import 'package:dio/dio.dart';
import 'package:flutter/material.dart';

class DioDemo extends StatefulWidget {
  const DioDemo({super.key});

  @override
  State createState() => _DioDemo();
}

class _DioDemo extends State<DioDemo> {
  @override
  void initState() {
    loadData();
    super.initState();
  }

  loadData() async {
    String baseUrl = 'https://mock.boxuegu.com/mock';
    Dio dio = Dio();
    Response res = await dio.get('$baseUrl/1172/orders');

    print(res.data);
  }

  @override
  Widget build(BuildContext context) {
    return const Text('Dio 插件');
  }
}
